//
//  FoodPointsView.swift
//  FoodStore
//
//  Created by youwei on 2025/5/2.
//

import SwiftUI

struct FoodPointsView: View {
    
    var points: Float
    var num: Int
    
    private var pointsStr: String {
        String(format: "%.1f", points)
    }
    
    var body: some View {
        HStack(spacing: 4.0) {
            Image(.iconStar)
            Text(pointsStr)
                .font(.inter(size: 14.0, weight: .semiBold))
                .foregroundStyle(.fs191919)
            Text("(\(num))")
                .font(.inter(size: 14.0, weight: .regular))
                .foregroundStyle(.fs9C9C9C)
        }
    }
}

#Preview {
    FoodPointsView(points: 4.0, num: 2000)
}
